/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.company.Logic;

import com.company.primitivies.Point2d;
import java.util.Map;
import java.util.Map.Entry;
import org.jzy3d.plot3d.builder.Mapper;

/**
 *
 * @author admin
 */
public class MeasureMapper extends Mapper {

    private Map<Point2d, Double> map;

    public MeasureMapper(double a, double b, double h) {
        Measure measure = new Measure(a, b);
        map = measure.stretch(h);

    }

    @Override
    public double f(double d, double d1) {
        Point2d point = new Point2d(d, d1);
        for (Entry<Point2d, Double> entry : map.entrySet()) {

            Point2d key = entry.getKey();
            if (point.equals(key)) {
                double res=entry.getValue();
                return res;
            }
        }
        return 0;
    }

}
